﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Collections;
using System.Text;

/// <summary>
/// Summary description for XL_KH
/// </summary>
public class XL_LOAI_TK
{
    
    protected DataRow Dong;
    protected static String Tenbang = "LOAI_TAI_KHOAN";
    
    public int MLTK
    {
        get
        {
            return (int)this.Dong["MLTK"];
        }
        set
        {
            this.Dong["MLTK"] = value;
        }
    }
    public string Loai_TK
    {
        get
        {
            return this.Dong["Loai_TK"].ToString();
        }
        set
        {
            this.Dong["Loai_TK"] = value;
        }
    }
  
    
    public XL_LOAI_TK(DataRow DongN)
	{
		//
		// TODO: Add constructor logic here
		//
        this.Dong = DongN;
	}

    public XL_LOAI_TK()
    {
        String sql="select * from LOAI_TAI_KHOAN";
        DataTable Bang  = DataProvider.ExecuteStructureQuery(sql);
        Dong = Bang.NewRow();
        Bang.Rows.Add(Dong);
    }
        
    public static ArrayList Doc_danh_sach()
    {
        ArrayList Kq = new ArrayList();       
        string sql = "Select * ";
        sql += " From " + Tenbang;
        DataTable Bang = DataProvider.ExecuteQuery(sql);
        foreach (DataRow DT in Bang.Rows)
        {
             XL_LOAI_TK LTK = new XL_LOAI_TK(DT);
             Kq.Add(LTK);
        }
        return Kq;
    
    }
   
  public void Ghi()
  {
                
        //Ghi Bang
        DataProvider.Save(this.Dong, Tenbang);
        
  }
    public void Xoa()
    {
        DataProvider.Delete(this.Dong, Tenbang);
        
    }
      
}

    
    
   